//存储TOKEN
export const SET_TOKEN = (token) => {
  uni.setStorageSync("TOKEN", token);
};
//本地存储获取数据
export const GET_TOKEN = () => {
  return uni.getStorageSync("TOKEN");
};
//本地存储删除数据方法
export const REMOVE_TOKEN = () => {
  uni.removeStorageSync("TOKEN");
};
//存储用户信息
export const SET_INFO = (info) => {
  uni.setStorageSync("info", info);
};
//本地存储获取用户信息
export const GET_INFO = () => {
  return uni.getStorageSync("info");
};
//本地存储删除用户信息
export const REMOVE_INFO = () => {
  uni.removeStorageSync("info");
};

/**
 * 设置特来电 token
 * @param {*} token
 */
export const SET_TELD_TOKEN = (token) => {
  uni.setStorageSync("TELD_TOKEN", token);
};

/**
 * 获取特来电 token
 * @param {*} token
 */
export const GET_TELD_TOKEN = () => {
  return uni.getStorageSync("TELD_TOKEN");
};

/**
 * 移除特来电 token
 * @param {*} token
 */
export const REMOVE_TELD_TOKEN = () => {
  uni.removeStorageSync("TELD_TOKEN");
};
/**
 * 设置 teld token 过期时间
 *
 */

export const SET_TELD_TOKEN_EXPIRE_TIME = () => {
  uni.setStorageSync(
    "TELD_TOKEN_EXPIRE_TIME",
    new Date().getTime() + 7000 * 1000
  );
};

/**
 * 获取 teld token 过期时间
 * @returns  TELD_TOKEN_EXPIRE_TIME
 */

export const GET_TELD_TOKEN_EXPIRE_TIME = () => {
  return uni.getStorageSync("TELD_TOKEN_EXPIRE_TIME") || 0;
};

/**
 * 设置 openid
 * @param {*} id
 */
export const SET_OPENID = (id) => {
  uni.setStorageSync("OPENID", id);
};

/**
 * 获取 openid
 */
export const GET_OPENID = () => {
  return uni.getStorageSync("OPENID");
};

/**
 * 移除 openid
 */
export const REMOVE_OPENID = () => {
  uni.removeStorageSync("OPENID");
};

/**
 * 设置 session_key
 * @param {*} id
 */
export const SET_SESSION_KEY = (id) => {
  uni.setStorageSync("WX_SESSION_KEY", id);
};

/**
 * 获取 session_key
 */
export const GET_SESSION_KEY = () => {
  return uni.getStorageSync("WX_SESSION_KEY");
};

/**
 * 移除 session_key
 */
export const REMOVE_SESSION_KEY = () => {
  uni.removeStorageSync("WX_SESSION_KEY");
};

/**
 * 设置 isBindTip
 * @param {*} id
 */
export const SET_IS_BIND_TIP = (isBindTip) => {
  uni.setStorageSync("isBindTip", isBindTip);
};

/**
 * 获取 isBindTip
 * @param {*} id
 */
export const GET_IS_BIND_TIP = (isBindTip) => {
  return uni.getStorageSync("isBindTip");
};
